#include<set>
#include<iostream>
using namespace std;
void change(string &s);
int main(){
	set<string>a;
	int n;
	bool b;
	string c;
	cin>>n;
	while(n--){
		cin>>b>>c;
		change(c);
		if(b)
			if(a.count(c))
				cout<<"Yes"<<endl;
			else
				cout<<"No"<<endl;
		else
			a.insert(c);
	}
	return 0;
}
void change(string &s){
	int i,j=s.size();
	for(i=0;i<j;++i)
		if(s[i]>='A'&&s[i]<='Z')
			s[i]+=32;
}